var express = require('express');
var router = express.Router();

var checkLogin = require('../middlewares/check').checkLogin;

// GET /signout 登出
router.get('/', checkLogin, function(req, res, next) {
  // 清空 session 中用户信息
  req.session.user = null;
  //res.cookie('hello','world');设置cookie
  //res.clearCookie('hello');清除cookie
  //req.cookies.hello;读取特定key的cookie
  console.log(req.cookies);
  res.send({hello:"world"});
});


module.exports = router;
